package com.guigu.qingcheng.controller;

import com.guigu.qingcheng.service.TbStockBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SkuTask {
    @Autowired
    private TbStockBackService tbStockBackService;


    /**
     * 间隔一小时执行库存回滚
     */
    //@Scheduled(cron = "0 */1 * * * ?")
    @Scheduled(cron = "0 0 0/1 * * ?")
    public void skuStockBack(){
        System.out.println("执行========skuStockBack()");
        tbStockBackService.doBack();
    }
}
